@value unit, fixed-z-index, border-radius from '../global/global.css';
@value gradientStart: rgba(255, 255, 255, 0);
@value gradientStop: rgba(255, 255, 255, 0.8);

.island {
  display: flex;
  flex-direction: column;

  border: 1px solid rgba(0, 42, 76, 0.1);
  border-radius: border-radius;
  background-color: #fff;
  box-shadow: 0 1px 4px rgba(0, 42, 76, 0.15);
}

.withTransparentBottomBorder {
  transition: border-bottom-color 0.1s;

  border-bottom: 1px solid transparent;
}

.header {
  composes: withTransparentBottomBorder;

  box-sizing: border-box;
  width: 100%;
  padding: 0 calc(unit * 4);

  line-height: 28px;
}

.withBottomBorder.withBottomBorder {
  border-bottom-color: rgba(0, 42, 76, 0.1);
  border-top-left-radius: border-radius;
  border-top-right-radius: border-radius;
}

.title {
  display: block;
  float: left;

  transform-origin: 0 50%;
  word-break: break-word;

  font-weight: bold;
}

.narrowIsland .header {
  padding: 0 calc(unit * 2);
}

.content {
  position: relative;

  display: flex;
  overflow: auto;

  width: 100%;
}

.scrollableWrapper {
  composes: islandScrollableWrapperInsideDialog from '../dialog/dialog.css';

  overflow: auto;

  width: 100%;
  padding: calc(unit * 2) calc(unit * 4);
}

.narrowIsland .scrollableWrapper {
  padding: calc(unit * 2) calc(unit * 2);
}

.withoutPaddings .scrollableWrapper {
  padding: 0;
}

.contentWithTopFade::before {
  position: absolute;
  z-index: fixed-z-index;
  left: 0;

  display: block;

  width: 100%;
  height: calc(unit * 3);

  content: '';
  pointer-events: none;

  background: linear-gradient(gradientStop, gradientStart); /* stylelint-disable-line function-linear-gradient-no-nonstandard-direction */
}

.contentWithBottomFade::after {
  position: absolute;
  bottom: 0;
  left: 0;

  display: block;

  width: 100%;
  height: calc(unit * 3);

  content: '';
  pointer-events: none;

  border-bottom-right-radius: border-radius;
  border-bottom-left-radius: border-radius;
  background: linear-gradient(gradientStart, gradientStop);
}
